package com.Gwo.basic.utils;

import lombok.Data;

@Data
public class Result {
    private String msg;
    private Boolean success;

    public static Result me(){
        return new Result();
    }

    public Result setString(String msg){
        this.msg=msg;
        return this;
    }

    public Result setSuccess(Boolean success){
        this.success=success;
        return this;
    }

    public Result success(){
        return me().setString("操作成功！").setSuccess(true);
    }
    public Result success(String msg){
        return me().setString(msg).setSuccess(true);
    }
    public Result fail(){
        return me().setString("操作失败！").setSuccess(false);
    }
    public Result fail(String msg){
        return me().setString(msg).setSuccess(false);
    }
}
